Device including means for transferring information indicating wether or not the device supports dma

ABSTRACT

A device for attachment to a host for serial data communication including means for transferring to the host a predetermined data structure indicating whether or not the device supports direct memory access.

A The present invention relates to a host and a device connected forserial data communication. In particular it relates to the extension ofthe Universal Serial Bus (USB) Standard “Universal Serial BusSpecification Revision 2.2”.

The inventors have identified an area in which the current USBSpecification could be improved. Currently, when a USB host sends datato a destination in an attached USB device, the device's processor mustbe interrupted to transfer the data from the buffer in which it istemporarily stored when received to its destination. The USB host cantherefore add to the processing load of the attached device. Thus a datatransfer may result in the hanging of an application running on theprocessor or other undesirable affects.

It would be desirable to improve the mechanism by which data istransferred between host and device.

It would be desirable to provide a mechanism by which the host canreduce undesirable consequences in the device resulting from a datatransfer.

According to a first aspect of the invention there is provided a devicefor attachment to a host for serial data communication comprising: meansfor transferring to the host a predetermined data structure indicatingwhether or not the device supports direct memory access.

The means for transferring may be responsive to a request from the host,for example, in USB, the device is polled by the host. The predetermineddata structure may be one of a plurality of data structures transferredat one time to the host. These data structures preferably provide thecapabilities of the device to the host. The device may be a USB device,the host a USB host and the data structures may be a series of USBdescriptors, provided at enumeration of the device. The predetermineddata structure may be a non-standard descriptor that extends another,preferably preceding, descriptor.

According to a second aspect of the present invention there is provideda host for attachment to a device for serial data communicationcomprising:

transfer means for transferring a predetermined data structureidentifying whether or not the device supports direct memory access,from the device to the host.

The transfer means may be arranged to request the device to send atleast the predetermined data structure, for example, in USB the deviceis polled by the host. The predetermined data structure may be one of aplurality of data structures transferred at one time to the host Thesedata structures preferably provide the capabilities of the device to thehost. The device may be a USB device, the host a USB host and the datastructures may be a series of USB descriptors, provided at enumerationof the device. The predetermined data structure may be a non-standarddescriptor that extends another, preferably preceding, descriptor. Thehost may further comprise allocation means for allocating tasks relatingto data transfer from/to the device in dependence upon the content ofthe predetermined data structure.

According to a third aspect of the present invention there is provided asystem comprising a host, a device and a serial data interconnectbetween the host and device, comprising: means for transferring, fromthe device to the host via the serial data interconnect, a predetermineddata structure indicating whether or not the device supports directmemory access.

Embodiments of the invention provide a mechanism by which a hostdetermines whether an attached device supports direct memory access(DMA) for certain functions. With this information, the host can choosewhether or not to communicate with an interface/endpoint of the devicewhich supports DMA or with an interface/endpoint of the device whichdoes not support DMA This allows the host flexibility in scheduling thetransfer of data across the bus connecting the host and device andallows the host to optimise use of the device. The use by the host of aninterface/endpoint which supports DMA, reduces the loading on thedevice's processor, as processor interrupts are no longer required totransfer the data to its destination. This is particularly advantageousfor mobile devices, such as mobile cellular telephones, which may havelow power processors that are used to simultaneously run userapplications.

In most USB devices, if DMA is supported, it would be supported by boththe inbound and the outbound endpoints. In a preferred embodiment, thehost determines if an interface supports DMA, it being assumed that ifthe interface supports DMA then both the inbound and outbound endpointssupport DMA. This provides for a simplified implementation of theinvention.

For a better understanding of the present invention and to understandhow the same may be brought into effect, reference will now be made byway of example only to the accompanying drawings in which:

FIG. 1 is a schematic illustration of a USB system; and

FIG. 2 illustrates the information transferred from the device to thehost.

FIG. 1 illustrates a device 14 for attachment to a host 16 for serialcommunication comprising: means 27 for transferring to the host apredetermined data structure 46, 56 indicating whether or not the devicesupports direct memory access. It also illustrates a host 16 forattachment to a device 14 for serial data communication comprising:transfer means 26 for transferring, from the device 14 to the host 16, apredetermined data structure 46, 56 identifying whether or not thedevice supports direct memory access to the memory 29.

The Universal serial bus (USB) is a cable bus that supports dataexchange between a host computer 20 and a wide range of simultaneouslyaccessible peripherals 14. The attached peripherals 14 share USBbandwidth through a host-scheduled, token-base protocol. The bus 12allows peripherals to be attached, configured, used and detached whilethe host and other peripherals are in operation.

FIG. 1 is a schematic illustration of a Universal serial bus (USB)system 10 comprising a USB interconnect 12 connecting a USB device 14 toa USB host 16. The USB host may be a computer 20 having a bus 22connecting a processor 24 to a USB Host Controller 26 and a memory 28.The USB Host controller 26 connects the computer 20 to the USBinterconnect 12.

In this example, the device 14 comprises an interface 27 which connectsto the interconnect 12 a bus 23 that connects the interface 27 to aprocessor 25 and a memory 29. The interface may be able to access thememory 29 for reading or writing directly using direct memory access(DMA) or, alternatively, using the bus 23 which is under the control ofthe processor 25.

The USB system 10 transfers data in bit serial format between the USBhost 16 and the USB device 14. There is only one host in a USB systemand it is master of the bus. The USB is a polled bus and the Hostinitiates all data transfers which are either a read from or a write toan endpoint.

An endpoint is a source or sink of data. Each endpoint has a memorybuffer which buffers the data before it proceeds to its ultimatedestination. The host can sent data to the memory buffer or request datafrom the memory buffer.

Data transfer between a host 16 and a device 14, occurs between the host16 and a data endpoint and is referred to as a pipe. The pipe determinesthe direction of data flow, the type of data flow e.g. bulk, isochronousor control, and how much bandwidth is allocated to the data transfer.

When the USB device 14 is initially connected to the system 10, busenumeration occurs. This is the process by which the device is allocatedan address and data is sent from the device to the host that identifiesthe capabilities of the device and enables communications between thehost and device.

The USB host 16 communicates with a USB device 14 by sending packets tothe USB device 14 addressed using the assigned address.

All USB devices must support a specially designated pipe at endpointzero. Associated with endpoint zero is the information required tocompletely describe the device to the host on enumeration. Thisinformation includes device, configuration, interface and endpointdescriptors. The descriptors report the attributes of the USB device tothe host.

A descriptor is a data structure with a defined format. Each descriptorbegins with a byte-wide field that contains the total number of bytes inthe descriptor followed by a byte-wide field that identifies thedescriptor type.

A device descriptor uniquely identifies the device and informs the hostof the number of configurations the device has.

A configuration descriptor informs the host of the devices differentpossible configurations e.g. self-powered and/or bus powered. It alsoinforms the host of the number of interfaces it has.

Each interface is a grouping of endpoints into a functional group thatperforms a single feature of the device. For example, in a combinedfax/scanner/printer device there would be one interface and oneinterface descriptor for each of the fax, scanner and printer functions.The fax interface descriptor specifies the inbound endpoint and outboundendpoint used for faxing. The scanner interface descriptor specifies thedifferent endpoints used for scanning. The printer interface descriptorspecifies the additional endpoints used for printing.

According to a first embodiment of the invention, a new non-standard DMAdescriptor is defined. This descriptor is used to extend the interfacedescriptor and tells the host whether or not DMA is available on thatinterface. The DMA descriptor immediately follows the interfacedescriptor it extends, during the enumeration process.

FIG. 2 illustrates the information transferred from the device to thehost during the enumeration process and stored at endpoint zero of thedevice. The information 30, in the example illustrated, comprises adevice descriptor 32, a configuration descriptor 34, a first interfacedescriptor 40 and a second interface descriptor 50, first and secondendpoint descriptors 42 and 44 which are associated with the firstinterface and third and fourth interface descriptors 52 and 54 which areassociated with the second interface. The first 42 and second 44endpoint descriptors follow the descriptor 40 of the interface withwhich they are associated. The third 52 and fourth 54 endpointdescriptors follow the descriptor 50 of the interface with which theyare associated. A first DMA descriptor 46 associated with the firstinterface immediately follows and extends the first interface descriptor40. A second DMA descriptor 56 associated with the second interfaceimmediately follows and extends the second interface descriptor 50.

A DMA descriptor is a data structure with a defined format. It beginswith a byte-wide field that contains the total number of bytes in thedescriptor followed by a byte-wide field that identifies the descriptortype.

The format of the descriptor is as follows: bFunctionLength 0x04bDescriptorType 0x24 bDescriptorSubtype 0xFD bDMA available 0x00/0x01

The value for bFunctionLength is determined by the Universal Serial BusSpecification. The value for the bDescriptorType is also defined by theUniversal Serial Bus Specification and it identifies the CommunicationDevice Class. The bDescriptorSubtype value is one of many defined valuesin the Communication Device Class which are free to use. It is used toidentify the DMA descriptor. The value of bDMAavailable indicateswhether or not DMA is supported by the interface (0x00 indicates no DMA,0x01 indicates DMA is available).

The host uniquely identifies the received descriptor as a DMA descriptorfrom the bDescriptorType and bDescriptorSubtype fields.

In this embodiment, it is assumed that if an interface supports DMA theneach of the endpoints associated with that endpoint also support DMA.The host determines which interfaces are capable of supporting DMA. Thehost has intelligence capable of assigning different data transfer tasksto different interfaces so that the transfer of data is optimisedwithout overburdening the processor of the device.

According to an alternative embodiment, the DMA descriptor is used toextend an endpoint descriptor instead of an interface descriptor. Inthis embodiment an endpoint descriptor immediately follows the interfacedescriptor and the DMA descriptor associated with an endpointimmediately follows and extends its endpoint descriptor. Each endpointdescriptor preferably has an associated DMA descriptor. In thisalternative embodiment, it is assumed that whether or not an endpoint ofan interface supports DMA is independent of whether or not the otherendpoints of the interface support DMA.

Whilst endeavouring in the foregoing specification to draw attention tothose features of the invention believed to be of particular importanceit should be understood that the Applicant claims protection in respectof any patentable feature or combination of features hereinbeforereferred to and/or shown in the drawings whether or not particularemphasis has been placed thereon.

1. A device for attachment to a host for serial data communicationcomprising: means for transferring to the host a predetermined datastructure indicating whether or not the device supports direct memoryaccess.
 2. A device as claimed in claim 1, wherein the means fortransferring is responsive to a request from the host.
 3. A device asclaimed in claim 1, wherein the predetermined data structure is one of aplurality of data structures transferred at one time to the host.
 4. Adevice as claimed in claim 1, wherein the device is a USB device and thepredetermined data structure is a descriptor.
 5. A device as claimed inclaim 4, wherein the descriptor is a non-standard descriptor.
 6. Adevice as claimed in claim 4, wherein the predetermined data structureextends a preceding descriptor.
 7. A device as claimed in claim 4,wherein the predetermined data structure is transferred during thedevice enumeration.
 8. A host for attachment to a device for serial datacommunication comprising: transfer means for transferring apredetermined data structure identifying whether or not the devicesupports direct memory access, from the device to the host.
 9. A host asclaimed in claim 8, wherein the transfer means is arranged to requestthe device to send at least the predetermined data structure.
 10. A hostas claimed in claim 8, wherein the predetermined data structure is oneof a plurality of data structures transferred at one time to the host.11. A host as claimed in claim 8, wherein the host is a USB host and thepredetermined data structure is a descriptor.
 12. A host as claimed inclaim 11, wherein the descriptor is a non-standard descriptor.
 13. Ahost as claimed in claim 11, wherein the predetermined data structureextends a previously transferred descriptor.
 14. A host as claimed inclaim 8, further comprising allocation means for allocating tasksrelating to data transfer from/to the device in dependence upon thecontent of the predetermined data structure.
 15. A host as claimed inclaim 11, wherein the predetermined data structure is transferred duringthe enumeration of the device by the host.
 16. A system comprising ahost, a device and a serial data interconnect between the host anddevice, comprising: means for transferring, from the device to the hostvia the serial data interconnect, a predetermined data structureindicating whether or not the device supports direct memory access. 17.(canceled)
 18. (canceled)